class Comment < ApplicationRecord
  belongs_to :user
  belongs_to :post
  validates :content, presence: {message:'评论内容不能为空'}, length: { maximum: 256 ,message: '评论过长，请控制在256字符内'}
  validates :user_id, presence: {message:'传入参数错误'}
  validates :post_id, presence: {message:'传入参数错误'}
end
